package com.UI;

import com.Model.StudentDBModel;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class ViewFacultyHours extends Activity{
	String comboID;
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.view_faculty_hours);
		
		Bundle extras = getIntent().getExtras();
		comboID = extras.getString("FacCourseComboID");
        
    	TextView output=(TextView) this.findViewById(R.id.printFacultyHours);
    	
    	StudentDBModel model = new StudentDBModel(this);
    	
    	StringBuilder facultyHours = model.displayFacultyHours(comboID);
    	
        output.setText(facultyHours);
        
        Button btnGoHome = (Button) findViewById(R.id.btnHome);
		btnGoHome.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go to the home page
				Intent goHome = new Intent(ViewFacultyHours.this, HomePage.class);
				startActivity(goHome);
				//finish the activity to return to the calling event
				ViewFacultyHours.this.finish();
			}
		});
		
		// register this activity as a button event listener
		Button btnGoBack = (Button) findViewById(R.id.btnBack);
		btnGoBack.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View component) {
				// go back to the pick class event view
				ViewFacultyHours.this.finish();
			}
		});
	}
}
